package com.heima.model.wemedia.pojos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
//<---自媒体图文内容信息表--->
@Data
@TableName("wm_news")
public class WmNews implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)//<---主键--->
    private Integer id;
    @TableField("user_id")//自媒体用户ID
    private Integer userId;
    @TableField("title")//标题
    private String title;
    @TableField("content")//图文内容
    private String content;
//<---文章布局
//            0 无图文章
//            1 单图文章
//            3 多图文章--->
    @TableField("type")
    private Short type;
    @TableField("channel_id")//图文频道ID
    private Integer channelId;
    @TableField("labels")
    private String labels;
    @TableField("created_time")//创建时间
    private Date createdTime;
    @TableField("submited_time")//提交时间
    private Date submitedTime;
    @TableField("status")//当前状态 0 草稿 1 提交（待审核） 2 审核失败   3 人工审核 4 人工审核通过 8 审核通过（待发布）9 已发布
    private Short status;
    @TableField("publish_time")//定时发布时间，不定时则为空
    private Date publishTime;
    @TableField("reason")//拒绝理由
    private String reason;
    @TableField("article_id")// 发布库文章ID
//    private BigInteger articleId;
    private Long articleId;
    @TableField("images")//图片用逗号分隔
    private String images;
    @TableField("enable")
    private Short enable;//是否上架
    @Alias("WmNewsStatus")//状态枚举类
    public enum Status{
        NORMAL((short)0),SUBMIT((short)1),FAIL((short)2),ADMIN_AUTH((short)3),ADMIN_SUCCESS((short)4),SUCCESS((short)8),PUBLISHED((short)9);
        short code;
        Status(short code){
            this.code = code;
        }
        public short getCode(){
            return this.code;
        }
    }

}